home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / DAKIT.ZIP / ANIM.H next >
Encoding:
C/C++ Source or Header  |  1990-10-11  |  3.2 KB  |  92 lines

  1. /*--anim.h----------------------------------------------------------
  2.  * anim definitions for ANIM2PCX.
  3.  */
  4.  
  5. /* --- DeluxePaint Animation currently imposes this limit, though
  6.  * file format is capable of more.
  7.  */
  8. #define MAX_SUPPORTED_FRAMES    (UWORD)9999
  9. #define MAX_FRAME_CHARS         4        /* # digits in MAX_SUPPORTED_FRAMES */
  10.  
  11. #define MAX_FRAMES    (UWORD)65534
  12.     /* Maximum # frames supported by current anim format.
  13.      * "65534": 1 left at end for "last-to-first" delta.
  14.      * NOTE: can't usefully be this large, as need free lp's during editting.
  15.      * Most anim's won't fit 255 pages per lp, so until we allow more than
  16.      * 255 lp's, won't reach MAX_FRAMES anyway.
  17.      */
  18. #define MAX_RECORDS    (UWORD)65535
  19.  
  20. #define FASTEST_RATE    70        /* Fastest rate anim can be played at. */
  21.  
  22. #define MAX_LARGE_PAGE_SIZE    (UWORD)(320*203)
  23.     /* WARNING: this may be stored in DP Animation's picture buffer,
  24.      * ASSUMES we've allocated three extra lines to the buffer.
  25.      * This allows us to come close to 64 KB, to minimize file wastage.
  26.      */
  27.  
  28. #define NBYTES_IN_BITMAP(bm)    ((UWORD)(bm)->width * (UWORD)(bm)->box.h)
  29.     /* TBD: ASSUMES < 64 KB.  Won't be true for Super-VGA. */
  30.  
  31. #define BSEG(bitmap)    (bitmap)->seg[0]
  32.  
  33. #define PALETTE_SIZE    (MAX_COLORS * sizeof(LONG))
  34.  
  35. #define FIRST_FRAME_N    1        /* Frame #s start at 1. */
  36. #define LAST_DELTA_N    (FIRST_FRAME_N-1)
  37.     /* Frame # used to store delta from last-frame to first. */
  38. #define LAST_FRAME_N    (animFrames-1+FIRST_FRAME_N)
  39. extern UWORD animFrames;
  40.  
  41. /* --------------- from IFF.H (Interchange File Format) ---------------
  42.  */
  43. /* --- Four-character IDentifier builder. */
  44. #define MakeID(d,c,b,a) ((LONG)(a)<<24 | (LONG)(b)<<16 | \
  45.                          (LONG)(c)<<8 | (LONG)(d) )
  46.  
  47.  
  48. /* --------------- anim file format -------------------- */
  49.  
  50. #define CCYCLE70    0        /* 70 Hz color-cycle interrupt */
  51.   /* P:Caused performance problems on slow machines, especially with cache on.
  52.    */
  53.  
  54. /* ---Bitmap body types. */
  55. #define BMBODY_UNCOMPRESSED    0
  56. #define BMBODY_RUNSKIPDUMP    1    /* Must match ANIMA.ASM/MakeRunSkipDump. */
  57.  
  58. /* --- RunSkipDump Bitmap body format.  Matches ANIM.INC*/
  59. #define OP_DUMP         0x00        /* | cnt */
  60. #define OP_RUN         0x00        /* Cnt in separate byte. */
  61. #define OP_SKIP         0x80        /* | cnt */
  62. #define LONG_OP         0x80
  63. #define LONG_SKIP      0x00        /* sub-ops for LONG_OP */
  64. #define LONG_DUMP      0x80
  65. #define LONG_RUN      0xC0
  66. #define MAX_SHORT_DUMP      127
  67. #define MAX_LONG_DUMP  0x3fff
  68. #define MAX_SHORT_RUN       255
  69. #define MAX_LONG_RUN   0x3fff
  70. #define MAX_SHORT_SKIP      127
  71. #define MAX_LONG_SKIP  0x7fff
  72. #define MIN_RUN         4    /* When in Dump, minimum worthwhile Run. */
  73. #define MIN_SKIP     2    /* When in Dump, minimum worthwhile Skip. */
  74. #define MIN_RUN_SKIP 4    /* When in Run, minimum worthwhile Skip. */
  75.     /* Note: deltaX.nBytes shorter if can subsume Skip in the Run,
  76.      * but PC screen i/o is slow enough that it is worth time-saving
  77.      * of having the Skip.
  78.      */
  79.  
  80. /*----------------------------------------------------------------------*/
  81. /* Color Cycles                                                            */
  82. /*----------------------------------------------------------------------*/
  83.  
  84. #define MAXNCYCS 16
  85. /* lpfile depends on the size of this structure */
  86. typedef struct {
  87.     WORD count;
  88.     WORD rate;
  89.     WORD flags;
  90.     UBYTE low, high;        /* bounds of range */
  91.     } Range;
  92.